package cst.a220tbc.widgettest_220tbc;

import android.content.DialogInterface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{
    private EditText input;
 //   private TextView to_view;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        input = (EditText) findViewById(R.id.Input);
      //  to_view =findViewById(R.id)

        findViewById(R.id.button_Input).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId())
        {
            case R.id.button_Input:
                Toast.makeText(this, "内容是："+input.getText().toString(), Toast.LENGTH_SHORT).show();
        }

    }
}
